Split out WGL/EGL stuff and simplify things
authorChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 14 Jul 2021 09:46:31 +0000 (17:46 +0800)
committerBenjamin Otte <otte@redhat.com>
Thu, 22 Jul 2021 14:28:16 +0000 (16:28 +0200)
commit6c001171197c58081516b9cb66801712afc14be6
treecff7c549ee3c145d0b5052f88626eb2a8d9dbedb
parent9c4c4eaaa121d784f591a591b95264647eaece96
Split out WGL/EGL stuff and simplify things

This commit attempts to split GdkWin32GLContext into two parts, one for
WGL and the other for EGL (ANGLE), and attempts to simplify things a
bit, by:

*  We are already creating a Win32 window to capture display changes,
   so we can just use that to act as our dummy window that we use to
   find out the pixel format that the system supports for WGL.  We also
   use it to obtain the dummy legacy WGL context that we will always
   require to create our more advanced Core WGL contexts.

*  Like what is done in X11, store up the WGL pixel format or the
   EGLConfig in our GdkWin32Display.

*  Ensure we do not create the dummy WGL context unnecessarily.

In this way, we can successfully create the WGL/EGL contexts, however
there are some issues at this point:

*  For WGL, the code successfully initializes and realizes the WGL
   Contexts, but for some reason things became invisible.  When running
   gtk4-demo, this can be verified by seeing the mouse cursor changing
   when moved to spots where one can resize the window, although they
   were invisible.

*  For EGL, the code initializes EGL but could not realize the EGL
   context as shaders failed to compile.  It seems like the shader issue
   is definitely outside the scope of this MR.
gdk/win32/gdkdisplay-win32.c
gdk/win32/gdkdisplay-win32.h
gdk/win32/gdkglcontext-win32-egl.c [new file with mode: 0644]
gdk/win32/gdkglcontext-win32-wgl.c [new file with mode: 0644]
gdk/win32/gdkglcontext-win32.c
gdk/win32/gdkglcontext-win32.h
gdk/win32/gdksurface-win32.c
gdk/win32/gdksurface-win32.h
gdk/win32/meson.build